﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using Inmobiliaria.Presenters.ViewInterfaces;
using System.Collections.Specialized;
using Inmobiliaria.Presenters.WFPresenters.Recursos;
//using Inmobiliaria.Services.Core.Interfaces;



namespace Inmobiliaria.Presenters.WFPresenters
{
    public class PubliqueAquiPresenter : Presenter
    {
        private IViewPubliqueAquiWUC viewPubliqueAquiWUC;

        public PubliqueAquiPresenter(IViewPubliqueAquiWUC view): base(view)
        {
            viewPubliqueAquiWUC = view;
        }
        public override void InitView(NameValueCollection queryString)
        {
        }
        public void Validar()
        {
            if (!(viewPubliqueAquiWUC.CheckInmobiliaria || viewPubliqueAquiWUC.CheckParticular) || (viewPubliqueAquiWUC.CheckInmobiliaria & viewPubliqueAquiWUC.CheckParticular))
            {
                throw new ApplicationException(PubliqueAqui.TipoDeventa);
            }

            if (viewPubliqueAquiWUC.CheckParticular == true)
            {
                HttpContext.Current.Response.Redirect("PublicarParticularInmueblesWF.aspx");
            }
            if (viewPubliqueAquiWUC.CheckInmobiliaria == true)
            {
                HttpContext.Current.Response.Redirect("PublicarInmobiliariaInmueblesWF.aspx");
            }
        }
    }
}
